Full Stack Django and React by Kolawole Mangabo

Full Stack Django and React by Kolawole Mangabo

Author:Kolawole Mangabo
Language: eng
Format: epub
Publisher: Packt Publishing Pvt. Ltd.
Published: 2023-02-14T00:00:00+00:00


src/components/post/CreatePost.jsx

… function CreatePost() { const [show, setShow] = useState(false); const handleClose = () => setShow(false); const handleShow = () => setShow(true); return ( <> <Form.Group className="my-3 w-75"> <Form.Control className="py-2 rounded-pill border-primary text-primary" type="text" placeholder="Write a post" onClick={handleShow} /> </Form.Group> {/*Add modal code here*/} </> ); } export default CreatePost;

We are first adding the input that will trigger the Modal to be displayed. A click on the modal will set the show state to True, the state that is used for opening the modal. Let’s add the code for the modal:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.